﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace SavedSearches
{
    /// <summary>
    /// Service interface.
    /// </summary>
    [ServiceContract]
    public interface ISavedSearchesService
    {
        /// <summary>
        /// Save the given search performed by the given user.
        /// </summary>
        /// <param name="user">the user that executed the query</param>
        /// <param name="query">the query that was executed</param>
        /// <returns></returns>
        [OperationContract]
        int SaveUserSearch(string user, string query);

        /// <summary>
        /// Return all the searches performed by the given user.
        /// </summary>
        /// <param name="user">the user to search for</param>
        /// <returns>all queries executed by the given user</returns>
        [OperationContract]
        string[] GetSearchesForUser(string user);

        /// <summary>
        /// Return all the users that have stored search data.
        /// </summary>
        /// <returns>all users that have stored search data</returns>
        [OperationContract]
        string[] GetAllUsers();
    }
}
